package com.axcbd.demo.repository;


import com.axcbd.demo.model.Acceleration;
import com.axcbd.demo.model.WaterLevel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AccelerationRepository extends JpaRepository<Acceleration,Integer> {

    @Query(value = "SELECT * FROM acceleration ORDER BY created_at DESC LIMIT ?1", nativeQuery = true)
    List<Acceleration> findTopNByCreatedAtDesc(int n);
}
